#include <stdio.h>

int main(int argc, char *argv[])
{

    int n = 0;
    scanf("%d", &n);
    while (n--)
    {
        int size = 0;
        scanf("%d", &size);
        int nums[size];
        for (size_t i = 0; i < size; i++)
        {
            scanf("%d", &nums[i]);
        }
        //------冒泡排序-------
        for (size_t i = 0; i < size; i++)
        {
            for (size_t z = i+1; z < size; z++)
            {
                if(nums[i]>nums[z]){
                    int tep = nums[z];
                    nums[z] = nums[i];
                    nums[i] = tep;
                }
            }
        }
        //------冒泡排序结束-------
        int flag = 1, mid = nums[1] - nums[0];
        for (size_t i = size-1; i >=1 ; i--)
        {
            if(nums[i]-nums[i-1]!=mid)
                flag = 0;
        }

        if(flag)
            printf("yes\n");
        else
            printf("no\n");
        }

    return 0;
}